package training.minggu5.maven.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="t_penjualan_detail")
public class PenjualanDetail implements Serializable {

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name="id_penjualan_detail")
    private Integer id_penjualan_detail;

    @Column(name="jumlah")
    private Integer jumlah;

    @Column(name="harga")
    private BigDecimal harga;

    @ManyToOne
    private Barang barang;

    @ManyToOne
    @JoinColumn(name="det_penjualan_header_no_faktur")
    private PenjualanHeader det_penjualan_header;

    public PenjualanHeader getDet_Penjualan_header() {
        return det_penjualan_header;
    }

    public void setDet_Penjualan_header(PenjualanHeader det_penjualan_header) {
        this.det_penjualan_header = det_penjualan_header;
    }

    public Barang getBarang() {
        return barang;
    }

    public void setBarang(Barang barang) {
        this.barang = barang;
    }

    public BigDecimal getHarga() {
        return harga;
    }

    public void setHarga(BigDecimal harga) {
        this.harga = harga;
    }

    public Integer getId_penjualan_detail() {
        return id_penjualan_detail;
    }

    public void setId_penjualan_detail(Integer id_penjualan_detail) {
        this.id_penjualan_detail = id_penjualan_detail;
    }

    public Integer getJumlah() {
        return jumlah;
    }

    public void setJumlah(Integer jumlah) {
        this.jumlah = jumlah;
    }
}
